<%--<%@ page import="com.shop.service.StudentService" %>--%>
<%--<%@ page import="com.shop.model.Student" %>&lt;%&ndash;--%>
<%--  Created by IntelliJ IDEA.--%>
<%--  User: Administrator--%>
<%--  Date: 2025/6/1--%>
<%--  Time: 下午6:11--%>
<%--  To change this template use File | Settings | File Templates.--%>
<%--&ndash;%&gt;--%>
<%--<%@ page contentType="text/html;charset=UTF-8" language="java" %>--%>
<%--<html>--%>
<%--<head>--%>
<%--    <title>VIP</title>--%>
<%--</head>--%>
<%--<body>--%>
<%--    <%--%>
<%--        String studentId = request.getParameter("studentId");--%>
<%--        System.out.println("vip:17:"+studentId);--%>
<%--        StudentService studentService = new StudentService();--%>
<%--        Student student = studentService.search(studentId);--%>
<%--        if(student.getIdentity().equals("学生VIP")){--%>
<%--            out.print("尊敬的Vip用户"+ (student.getName()!=null ? student.getName() : student.getStudentId())+",您好");--%>
<%--        }else if(student.getIdentity().equals("学生")){--%>
<%--            out.print("升级成为Vip用户,享受六折优惠！");--%>
<%--        }--%>
<%--    %>--%>
<%--    <p>花费￥188,升级成会员</p>--%>
<%--    <form action="updateIdentity" method="post">--%>
<%--        <input type="hidden" name="studentId" value="<%=studentId%>">--%>
<%--        <input type="submit" value="升级">--%>
<%--    </form>--%>
<%--</body>--%>
<%--</html>--%>


<%@ page import="com.shop.service.StudentService" %>
<%@ page import="com.shop.model.Student" %>
<%@ page import="com.shop.service.IStudentService" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>VIP会员中心</title>
    <style>
        :root {
            --vip-gold: #FFD700;
            --vip-purple: #8A2BE2;
            --primary-color: #4361ee;
            --secondary-color: #3a0ca3;
            --highlight-color: #FF6B6B;
            --border-radius: 8px;
            --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        }

        body {
            font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
            background-color: #f5f7ff;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            margin: 0;
            padding: 20px;
        }

        .vip-container {
            width: 100%;
            max-width: 500px;
            background: white;
            border-radius: var(--border-radius);
            box-shadow: var(--box-shadow);
            padding: 30px;
            text-align: center;
        }

        .vip-header {
            margin-bottom: 25px;
        }

        .vip-icon {
            color: var(--vip-gold);
            font-size: 48px;
            margin-bottom: 15px;
        }

        .vip-title {
            color: var(--vip-purple);
            font-size: 24px;
            margin-bottom: 10px;
        }

        .vip-greeting {
            font-size: 18px;
            color: #333;
            margin-bottom: 20px;
            padding: 15px;
            background-color: #f8f9fa;
            border-radius: var(--border-radius);
        }

        .vip-promotion {
            font-size: 20px;
            color: var(--vip-purple);
            font-weight: bold;
            margin-bottom: 15px;
        }

        .vip-price {
            font-size: 18px;
            color: #555;
            margin-bottom: 25px;
        }

        .price-amount {
            color: var(--highlight-color);
            font-weight: bold;
            font-size: 1.2em;
        }

        .upgrade-form {
            margin-top: 20px;
        }

        .upgrade-btn {
            background: linear-gradient(to right, var(--vip-purple), #9B30FF);
            color: white;
            border: none;
            padding: 12px 30px;
            border-radius: var(--border-radius);
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: var(--box-shadow);
            width: 100%;
        }

        .upgrade-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(138, 43, 226, 0.3);
        }

        .vip-benefits {
            margin-top: 20px;
            padding: 15px;
            background-color: #f0f7ff;
            border-radius: var(--border-radius);
        }

        .benefits-title {
            color: var(--primary-color);
            font-weight: bold;
            margin-bottom: 10px;
        }

        .benefits-list {
            text-align: left;
            padding-left: 20px;
        }
    </style>
</head>
<body>
<div class="vip-container">
    <div class="vip-header">
        <div class="vip-icon">★</div>
        <h1 class="vip-title">VIP会员中心</h1>

        <%
            String studentId = request.getParameter("studentId");
            System.out.println("vip:17:"+studentId);
            IStudentService istudentService = new StudentService();
            Student student = istudentService.search(studentId);
            if(student.getIdentity().equals("学生VIP")){
        %>
        <div class="vip-greeting">
            尊敬的VIP用户:<%= (student.getName()!=null ? student.getName() : student.getStudentId()) %>，您好！
        </div>
        <div class="vip-benefits">
            <div class="benefits-title">您已享受以下VIP特权：</div>
            <ul class="benefits-list">
                <li>所有课程六折优惠</li>
            </ul>
        </div>
        <%
        }else if(student.getIdentity().equals("学生")){
        %>
        <div class="vip-promotion">升级成为VIP用户，享受六折优惠！</div>
        <p class="vip-price">花费 <span class="price-amount">￥188</span>，升级成会员</p>
        <form action="updateIdentity" method="post" class="upgrade-form">
            <input type="hidden" name="studentId" value="<%=studentId%>">
            <button type="submit" class="upgrade-btn">立即升级</button>
        </form>
        <%
            }
        %>
    </div>
</div>
</body>
</html>